package sunbao.ido.thread;

public class MyThread7 extends Thread {

    /**
     * Java对象的wait()方法或者线程的sleep()方法时，需要捕获并处理InterruptedException异常
     */
    @Override
    public void run() {
        try {
//            Thread.sleep(20000);
            for (int i = 0; i < 1000; i++) {
                System.out.println(i);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
